import { getLevelData } from '@gx-design-vue/pro-utils'
import dayjs from 'dayjs'

// Pro Components
const proComponents: SystemMenuItem[] = [
  {
    createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
    icon: 'gx-zujian',
    iconFont: 'iconfont',
    menuId: 1,
    path: 'proComponents',
    redirect: '/proComponents/layout/waterMark',
    title: 'Pro组件',
    name: 'ProComponents',
    menuType: 'M',
    order: 1,
    parentId: 0,
    link: '',
    hidden: false,
    children: [
      {
        createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
        icon: 'gx-layout',
        iconFont: 'iconfont',
        menuId: 13,
        path: 'layout',
        redirect: '/proComponents/layout/waterMark',
        title: '布局',
        name: 'Layout',
        menuType: 'M',
        order: 1,
        parentId: 1,
        link: '',
        hidden: false,
        children: [
          {
            children: [],
            component: 'proComponents/layout/waterMark/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 14,
            path: 'waterMark',
            title: '水印组件',
            name: 'WaterMark',
            menuType: 'C',
            order: 1,
            parentId: 13,
            link: '',
            hidden: false,
          },
          {
            children: [],
            component: 'proComponents/layout/card/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 38,
            path: 'card',
            title: '高级卡片',
            name: 'ProCard',
            menuType: 'C',
            order: 2,
            parentId: 13,
            link: '',
            hidden: false,
          },
        ]
      },
      {
        createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
        icon: 'gx-wannengbiaodan',
        iconFont: 'iconfont',
        menuId: 39,
        path: 'dataEntry',
        title: '数据录入',
        name: 'DataEntry',
        menuType: 'M',
        order: 2,
        parentId: 1,
        link: '',
        hidden: false,
        children: [
          {
            children: [],
            component: 'proComponents/dataEntry/proForm/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 45,
            path: 'proForm',
            title: '高级表单',
            name: 'ProForm',
            menuType: 'C',
            order: 2,
            parentId: 39,
            link: '',
            hidden: false,
          },
          {
            children: [],
            component: 'proComponents/dataEntry/proUpload/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 50,
            path: 'proUpload',
            title: '高级上传',
            name: 'ProUpload',
            menuType: 'C',
            order: 2,
            parentId: 39,
            link: '',
            hidden: false,
          },
          {
            children: [],
            component: 'proComponents/dataEntry/proEditor/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 48,
            path: 'proEditor',
            title: '高级富文本',
            name: 'ProEditor',
            menuType: 'C',
            order: 3,
            parentId: 39,
            link: '',
            hidden: false,
          },
        ],
      },
      {
        createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
        icon: 'gx-shuju',
        iconFont: 'iconfont',
        menuId: 3,
        path: 'dataDisplay',
        title: '数据展示',
        name: 'DataDisplay',
        menuType: 'M',
        order: 3,
        parentId: 1,
        link: '',
        hidden: false,
        children: [
          {
            children: [],
            component: 'proComponents/dataDisplay/proTable/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 6,
            path: 'proTable',
            title: '高级表格',
            name: 'ProTable',
            menuType: 'C',
            order: 1,
            parentId: 3,
            link: '',
            hidden: false,
            tabState: {
              fixed: 0
            }
          },
        ],
      },
      {
        createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
        icon: 'gx-gengduo-tongyong',
        iconFont: 'iconfont',
        menuId: 4,
        path: 'universal',
        title: '通用',
        name: 'Universal',
        menuType: 'M',
        order: 4,
        parentId: 1,
        link: '',
        hidden: false,
        children: [
          {
            children: [],
            component: 'proComponents/universal/Media/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 49,
            path: 'media',
            title: '媒体',
            name: 'Media',
            menuType: 'C',
            order: 2,
            parentId: 4,
            link: '',
            hidden: false,
          },
          {
            children: [],
            component: 'proComponents/universal/proField/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 47,
            path: 'proField',
            title: '原子组件',
            name: 'ProField',
            menuType: 'C',
            order: 2,
            parentId: 4,
            link: '',
            hidden: false,
          },
        ]
      },
    ],
  },
]

// Pro Hooks
const proHooks: SystemMenuItem[] = [
  {
    createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
    icon: 'gx-gongjuxiang',
    iconFont: 'iconfont',
    menuId: 51,
    path: 'proHooks',
    redirect: '/proHooks/useRequest',
    title: 'proHooks',
    name: 'ProHooks',
    menuType: 'M',
    order: 2,
    parentId: 0,
    link: '',
    hidden: false,
    children: [
      {
        component: '/proHooks/useRequest/index',
        children: [],
        createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
        icon: 'gx-fuwuqingqiu',
        iconFont: 'iconfont',
        menuId: 52,
        path: 'useRequest',
        title: 'useRequest',
        name: 'UseRequest',
        menuType: 'C',
        order: 1,
        parentId: 51,
        link: '',
        hidden: false,
      },
    ],
  },
]

// Pro Page
const proPage: SystemMenuItem[] = [
  {
    createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
    icon: 'gx-iconset0335',
    iconFont: 'iconfont',
    menuId: 15,
    path: 'proPage',
    title: 'Pro页面',
    name: 'ProPage',
    menuType: 'M',
    order: 3,
    parentId: 0,
    link: '',
    hidden: false,
    children: [
      {
        createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
        icon: 'gx-wannengbiaodan',
        iconFont: 'iconfont',
        menuId: 16,
        path: 'form',
        title: '表单页',
        name: 'Form',
        menuType: 'M',
        order: 1,
        parentId: 15,
        link: '',
        hidden: false,
        children: [
          {
            children: [],
            component: 'proPages/form/basicForm/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 17,
            path: 'basicForm',
            title: '基础表单',
            name: 'BasicForm',
            menuType: 'C',
            order: 1,
            parentId: 16,
            link: '',
            hidden: false,
          },
          {
            children: [],
            component: 'proPages/form/stepForm/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 18,
            path: 'stepForm',
            title: '分布表单',
            name: 'StepForm',
            menuType: 'C',
            order: 2,
            parentId: 16,
            link: '',
            hidden: false,
          },
          {
            children: [],
            component: 'proPages/form/advancedForm/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 19,
            path: 'advancedForm',
            title: '高级表单',
            name: 'AdvancedForm',
            menuType: 'C',
            order: 2,
            parentId: 16,
            link: '',
            hidden: false,
          },
        ],
      },
      {
        createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
        icon: 'gx-biaoge',
        iconFont: 'iconfont',
        menuId: 20,
        path: 'list',
        title: '列表页',
        name: 'List',
        menuType: 'M',
        order: 2,
        parentId: 15,
        link: '',
        hidden: false,
        children: [
          {
            component: 'proPages/list/search/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 21,
            path: 'search',
            title: '搜索列表',
            name: 'SearchList',
            menuType: 'M',
            order: 1,
            parentId: 20,
            link: '',
            hidden: false,
            keepAlive: true,
            children: [
              {
                component: 'proPages/list/search/components/Articles',
                createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
                menuId: 53,
                path: 'articles',
                title: '搜索列表（文章）',
                name: 'SearchArticleList',
                menuType: 'C',
                order: 1,
                parentId: 21,
                link: '',
                hidden: false,
              },
              {
                component: 'proPages/list/search/components/Projects',
                createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
                menuId: 54,
                path: 'projects',
                title: '搜索列表（项目）',
                name: 'SearchProjectsList',
                menuType: 'C',
                order: 2,
                parentId: 21,
                link: '',
                hidden: false,
              },
              {
                component: 'proPages/list/search/components/Applications',
                createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
                menuId: 55,
                path: 'applications',
                title: '搜索列表（应用）',
                name: 'SearchApplicationsList',
                menuType: 'C',
                order: 3,
                parentId: 21,
                link: '',
                hidden: false,
              },
            ],
          },
          {
            children: [],
            component: 'proPages/list/tableList/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 22,
            path: 'tableList',
            title: '查询表格',
            name: 'TableList',
            menuType: 'C',
            order: 2,
            parentId: 20,
            link: '',
            hidden: false,
            keepAlive: true,
          },
          {
            children: [],
            component: 'proPages/list/basicList/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 23,
            path: 'basicList',
            title: '标准列表',
            name: 'BasicList',
            menuType: 'C',
            order: 3,
            parentId: 20,
            link: '',
            hidden: false,
          },
          {
            children: [],
            component: 'proPages/list/cardList/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 24,
            path: 'cardList',
            title: '卡片列表',
            name: 'CardList',
            menuType: 'C',
            order: 4,
            parentId: 20,
            link: '',
            hidden: false,
          },
        ],
      },
      {
        createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
        icon: 'gx-xiangqing',
        iconFont: 'iconfont',
        menuId: 25,
        path: 'profile',
        title: '详情页',
        name: 'Profile',
        menuType: 'M',
        order: 3,
        parentId: 15,
        link: '',
        hidden: false,
        children: [
          {
            children: [],
            component: 'proPages/profile/basic/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 26,
            path: 'profileBasic',
            title: '基础详情页',
            name: 'ProfileBasic',
            menuType: 'C',
            order: 1,
            parentId: 25,
            link: '',
            hidden: false,
          },
          {
            children: [],
            component: 'proPages/profile/advanced/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 27,
            path: 'advanced',
            title: '高级详情页',
            name: 'Advanced',
            menuType: 'C',
            order: 2,
            parentId: 25,
            link: '',
            hidden: false,
          },
        ],
      },
      {
        createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
        icon: 'gx-jieguoye',
        iconFont: 'iconfont',
        menuId: 28,
        path: 'result',
        title: '结果页',
        name: 'Result',
        menuType: 'M',
        order: 4,
        parentId: 15,
        link: '',
        hidden: false,
        children: [
          {
            children: [],
            component: 'proPages/result/success/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 29,
            path: 'success',
            title: '成功页',
            name: 'Success',
            menuType: 'C',
            order: 1,
            parentId: 28,
            link: '',
            hidden: false,
          },
          {
            children: [],
            component: 'proPages/result/fail/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 30,
            path: 'fail',
            title: '失败页',
            name: 'Fail',
            menuType: 'C',
            order: 2,
            parentId: 28,
            link: '',
            hidden: false,
          },
        ],
      },
      {
        createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
        icon: 'gx-yichangguanli',
        iconFont: 'iconfont',
        menuId: 31,
        path: 'exception',
        title: '异常页',
        name: 'ExceptionPage',
        menuType: 'M',
        order: 5,
        parentId: 15,
        link: '',
        hidden: false,
        children: [
          {
            children: [],
            component: 'proPages/exception/403/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 32,
            path: '403',
            title: '403',
            name: 'ExceptionPage403',
            menuType: 'C',
            order: 1,
            parentId: 31,
            link: '',
            hidden: false,
          },
          {
            children: [],
            component: 'proPages/exception/404/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 33,
            path: '404',
            title: '404',
            name: 'ExceptionPage404',
            menuType: 'C',
            order: 2,
            parentId: 31,
            link: '',
            hidden: false,
          },
          {
            children: [],
            component: 'proPages/exception/500/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 34,
            path: '500',
            title: '500',
            name: 'ExceptionPage500',
            menuType: 'C',
            order: 3,
            parentId: 31,
            link: '',
            hidden: false,
          },
        ],
      },
      {
        createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
        icon: 'gx-waibushuju',
        iconFont: 'iconfont',
        menuId: 41,
        path: 'webIframe',
        title: '外部页面',
        name: 'WebIframe',
        menuType: 'M',
        order: 7,
        parentId: 15,
        link: '',
        hidden: false,
        children: [
          {
            children: [],
            component: 'IframeView',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 42,
            title: 'antVue文档(内嵌)',
            name: 'AntVue',
            menuType: 'C',
            order: 1,
            linkStatus: 0,
            parentId: 41,
            path: 'antVue',
            link: 'https://next.antdv.com/components/overview-cn/',
            hidden: false,
          },
          {
            children: [],
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 43,
            title: 'procomponents(外链)',
            name: 'Procomponents',
            menuType: 'C',
            order: 2,
            linkStatus: 1,
            parentId: 41,
            link: 'https://procomponents.ant.design/',
            hidden: false
          }
        ],
      },
    ],
  },
]

// Account
const account: SystemMenuItem[] = [
  {
    createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
    icon: 'gx-gerenziliao',
    iconFont: 'iconfont',
    menuId: 2,
    path: 'account',
    title: '个人页',
    name: 'Account',
    menuType: 'M',
    order: 4,
    parentId: 0,
    link: '',
    hidden: false,
    children: [
      {
        component: 'account/center/index',
        createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
        menuId: 5,
        icon: 'gx-gerenzhongxin2',
        iconFont: 'iconfont',
        path: 'center',
        title: '个人中心',
        name: 'AccountCenter',
        menuType: 'M',
        order: 1,
        parentId: 2,
        redirect: '/account/center/articles',
        hidden: false,
        keepAlive: true,
        hideChildrenInMenu: true,
        children: [
          {
            component: 'account/center/components/Articles/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 56,
            path: 'articles',
            title: '个人中心',
            name: 'AccountArticleList',
            menuType: 'C',
            order: 1,
            parentId: 5,
            link: '',
            animateDisabled: true,
            menuSelectKey: '/account/center',
          },
          {
            component: 'account/center/components/Applications/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 58,
            path: 'applications',
            title: '个人中心',
            name: 'AccountApplicationsList',
            menuType: 'C',
            order: 1,
            parentId: 5,
            link: '',
            animateDisabled: true,
            menuSelectKey: '/account/center',
          },
          {
            component: 'account/center/components/Projects/index',
            createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
            menuId: 57,
            path: 'projects',
            title: '个人中心',
            name: 'AccountProjectsList',
            menuType: 'C',
            order: 1,
            parentId: 5,
            link: '',
            animateDisabled: true,
            menuSelectKey: '/account/center',
          },
        ]
      },
      {
        children: [],
        component: 'account/settings/index',
        createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
        icon: 'gx-gerenshezhi',
        iconFont: 'iconfont',
        menuId: 37,
        path: 'settings',
        title: '个人设置',
        name: 'AccountSettings',
        menuType: 'C',
        order: 2,
        parentId: 2,
        link: '',
        hidden: false,
      },
    ],
  },
]

// Setting
const settings: SystemMenuItem[] = [
  {
    createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
    icon: 'gx-xitongpeizhi',
    iconFont: 'iconfont',
    menuId: 10,
    path: 'system',
    title: '系统配置',
    name: 'System',
    menuType: 'M',
    order: 5,
    parentId: 0,
    link: '',
    hidden: false,
    children: [
      {
        children: [],
        component: 'system/menu/index',
        createTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
        icon: 'gx-a-zu5',
        iconFont: 'iconfont',
        menuId: 11,
        path: 'menu',
        title: '菜单管理',
        name: 'Menu',
        menuType: 'C',
        order: 7,
        parentId: 10,
        link: '',
        hidden: false,
      },
    ],
  },
]

export const menuList: SystemMenuItem[] = getLevelData([
  ...proComponents,
  ...proHooks,
  ...proPage,
  ...account,
  ...settings,
]).map(item => ({ ...item, children: [] }))
